<?php
	class monhocdb
	{
		public function Add($TenMonHoc,$HeSo)
		{
			$sql = "INSERT INTO `tbl_monhoc`(`TenMonHoc`,`HeSo`) VALUES (".dataservice::slashes($TenMonHoc).",$HeSo)";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function Delete($MaMonHoc)
		{
			$sql = "DELETE FROM `tbl_monhoc` WHERE MaMonHoc = $MaMonHoc";
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
		
		public function Update($MaMonHoc, $TenMonHoc, $HeSo)
		{
			$sql = "UPDATE `tbl_monhoc` SET TenMonHoc = ".dataservice::slashes($TenMonHoc).", HeSo = $HeSo WHERE MaMonHoc = '$MaMonHoc'"; 
			$data = new dataservice();
			return $data->ExecuteNonQuery($sql);
		}
	
		public function GetList($MaMonHoc, $TenMonHoc)
		{
			$sql = "SELECT * FROM `tbl_monhoc` WHERE 1";
			if($MaMonHoc!="")
				$sql .= " AND MaMonHoc = $MaMonHoc ";
			if($TenMonHoc!="")
				$sql .= " AND TenMonHoc LIKE '%$TenMonHoc%' ";
			$data = new dataservice();
			return $data->ExecuteQuery($sql);
		}
		public function Find($TenMonHoc)
		{
			$sql = "SELECT * FROM `tbl_monhoc` WHERE 1";
			if($TenMonHoc!="")
				$sql = " SELECT * FROM `tbl_monhoc` WHERE TenMonHoc LIKE '%$TenMonHoc%' ";
			$data = new dataservice();
			return $data->ExecuteQuery($sql);
		}
		
	}
?>